package calbs.socket.tool;/**
 * Created by zhangqin on 2017/8/14.
 */

/**
 * @author
 * @create 2017-08-14 11:39
 **/
public class XorTool {
    public static byte getXor(byte[] datas){

        if(datas==null||datas.length==0){
            return  0;
        }
        byte temp=datas[0];

        for (int i = 1; i <datas.length; i++) {
            temp ^=datas[i];
        }

        return temp;
    }

}
